#include "SimplePizzaFactory.h"

PizzaFactory::PizzaFactory() : pizza(nullptr)
{

}

PizzaFactory::~PizzaFactory()
{
    SAFE_DELETE_PTR(pizza);
}

Pizza* PizzaFactory::createPizza(const string &type)
{
    pizza = nullptr;
    if("cheese" == type) {
        pizza = new CheesePizza();
    } else if("pepperoni") {
        pizza = new PepperoniPizza();
    } else
    {
        // do nothing
    }

    return pizza;
}
